package com.googlecode.archimedes.filegen.generator;

import java.util.Collection;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.googlecode.archimedes.filegen.controller.GenerationException;
import com.googlecode.archimedes.filegen.model.Asset;
import com.googlecode.archimedes.filegen.template.Template;

/**
 * An abstract class to handle the general details around generation of code from templates. This
 * class should be extended by all concrete generation engines.
 * 
 * @author Erik Gustavson
 * @version $Id: AbstractGenerator.java 443 2005-06-13 03:56:59 +0000 (Mon, 13 Jun 2005) erik $
 *
 * Created on Oct 28, 2003
 */
public abstract class AbstractGenerator {

    Log                                 log = LogFactory.getLog(this.getClass());

    private String                      outputDirectoy;
    private String                      resourceDirectory;
    private String                      loggingDirectory;
    private String                      includeDirectory;
    private Template                    template;
    private Collection<? extends Asset> assets;

    public abstract void generate() throws GenerationException;

    /**
     * An abstract
     */
    public AbstractGenerator() {
        super();
    }

    /**
     * Document me!
     * 
     * @return
     */
    public String getIncludeDirectory() {
        return includeDirectory;
    }

    /**
     * Document me!
     * 
     * @param includeDirectory
     */
    public void setIncludeDirectory(String includeDirectory) {
        this.includeDirectory = includeDirectory;
    }

    /**
     * Document me!
     * 
     * @return
     */
    public String getLoggingDirectory() {
        return loggingDirectory;
    }

    /**
     * Document me!
     * 
     * @param loggingDirectory
     */
    public void setLoggingDirectory(String loggingDirectory) {
        this.loggingDirectory = loggingDirectory;
    }

    /**
     * Document me!
     * 
     * @return
     */
    public String getOutputDirectoy() {
        return outputDirectoy;
    }

    /**
     * Document me!
     * 
     * @param outputDirectoy
     */
    public void setOutputDirectoy(String outputDirectoy) {
        this.outputDirectoy = outputDirectoy;
    }

    /**
     * Document me!
     * 
     * @return
     */
    public String getResourceDirectory() {
        return resourceDirectory;
    }

    /**
     * Document me!
     * 
     * @param resourceDirectory
     */
    public void setResourceDirectory(String resourceDirectory) {
        this.resourceDirectory = resourceDirectory;
    }

    /**
     * Document me!
     * 
     * @return
     */
    public Collection<? extends Asset> getAssets() {
        return assets;
    }

    /**
     * Document me!
     * 
     * @param asset
     */
    public void setAssets(Collection<? extends Asset> assets) {
        this.assets = assets;
    }

    /**
     * Document me!
     * 
     * @return
     */
    public Template getTemplate() {
        return template;
    }

    /**
     * Document me!
     * 
     * @param template
     */
    public void setTemplate(Template template) {
        this.template = template;
    }
}
